home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / HyperTalk / Stack Starter ß.976 / Stack Starter fl.976 / stack.txt < prev   
Encoding:
Text File  |  1988-08-03  |  28.7 KB  |  1,138 lines

  1. -- stack: in.976
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 3
  11. -- first background id: 2295
  12. -- card count: 33
  13. -- first card id: 4644
  14. -- list block id: 13332
  15. -- print block id: 3448
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 430848 bytes
  21. -- stack block size: 30720 bytes
  22. -- created by hypercard version: 0x01208000
  23. -- compacted by hypercard version: 0x01208000
  24. -- modified by hypercard version: 0x01208000
  25. -- opened by hypercard version: 0x01208000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x0000220000002200
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0xCC003300CC003300
  30. -- patterns[4]: 0xCC883322CC883322
  31. -- patterns[5]: 0xEE88BB22EE88BB22
  32. -- patterns[6]: 0xEECCBB33EECCBB33
  33. -- patterns[7]: 0xFFCCFF33FFCCFF33
  34. -- patterns[8]: 0xFFEEFFBBFFEEFFBB
  35. -- patterns[9]: 0xFFFFFFBBFFFFFFBB
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x11AA448811AA4488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0x55AA55AA55AA55AA
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. on doMenu this
  69.   global menu1, menu2
  70.   if this is "Buttons" then go to card "the button breeder"
  71.   else if this is "Cover" then go to card "the stack starter"
  72.   else if this is "Controls" then go to card "the controls cultivator"
  73.   else if this is "Crash" then crash
  74.   else if this is "Effects" then go to card "the effects editor"
  75.   else if this is "Fields" then go to card "the field fabricater"
  76.   else if this is "Gauges" then go to card "Gauges"
  77.   else if this is "HyperEdit" then answer "Please, press the return Key and the shift Key"
  78.   else if this is "HyperSound‚Ñ¢" then go to stack "HyperSound"
  79.   else if this is "Icons" then go to card "the icon initiator"
  80.   else if this is "Info" then info
  81.   else if this is "Map" then go to card "the master map"
  82.   else if this is "OverLoad" then overLoad
  83.   else if this is "Panic" then panic
  84.   else if this is "Pause" then pause
  85.   else if this is "ResCopy" then ResCopy
  86.   else if this is "ResEdit" then open "ResEdit 1.1B3"
  87.   else if this is "Script of Bkgnd..." then bkgndScript
  88.   else if this is "Script of Button..." then btnScript
  89.   else if this is "Script of Card..." then cardScript
  90.   else if this is "Script of Field..." then fieldScript
  91.   else if this is "Script of Stack..." then stackScript
  92.   else if this is "Script of Home" then HomeScript
  93.   else if this is "Scripts" then answer "Sorry, This feature not yet supported"
  94.   else if this is "SoundEdit‚Ñ¢" then open SoundEdit
  95.   else if this is "Sounds" then go to card "the sound sampler"
  96.   else if this is "Tools" then go to card "the allover analyzer"
  97.   else if this is "Open Stack..." then
  98.     answer "Are you leaving this stack for good?" with "Yes" or "No" or "Cancel"
  99.     if it is "No" then pass doMenu
  100.     else if it is "Yes" then
  101.       egress
  102.       pass doMenu
  103.     end if
  104.   else if this is "Quit HyperCard" then
  105.     answer "Quit HyperCard or Shutdown the Mac?" with "Restart" or "Shutdown" or "Quit"
  106.     egress
  107.     if it is "Restart" then
  108.       doRestart
  109.       exit doMenu
  110.     else if it is "Shutdown" then shutdown
  111.     else
  112.       pass doMenu
  113.       exit doMenu
  114.     end if
  115.   else pass doMenu
  116.   hide msg
  117. end doMenu
  118.  
  119. on idle
  120.   global menu1, menu2, lastTick
  121.   --set userLevel to 5
  122.   if (the ticks-lastTick)>120 then
  123.     put the ticks into lastTick
  124.     ShowMenu menu1
  125.     ShowMenu menu2
  126.   end if
  127.   pass idle
  128. end idle
  129.  
  130. on startUp
  131.   global CheckUp, SaveLevel, Start, UserLevel
  132.   put the userLevel into SaveLevel
  133.   set userLevel to 5
  134.   set powerKeys to true
  135.   SetVolume(7)
  136.   hideSome
  137.   if CheckUp <> empty then exit startUp
  138.   hide menubar
  139.   hide btn id 6
  140.   getSpecsFirst
  141.   unlock
  142.   set hilite of btn id 2 to true
  143.   put 1 into CheckUp
  144.   unlock
  145.   set the cursor to 4
  146.   freeSpace
  147.   set hilite of btn id 2 to false
  148.   makeMenus
  149.   set hilite of btn id 2 to true
  150.   StartDown
  151.   show btn id 6
  152.   put empty into card field "Specs"
  153.   if the optionKey <> down then intro
  154.   visual effect dissolve
  155.   go card 11
  156.   show menuBar
  157.   set cursor to 4
  158.   lockcard
  159.   push card
  160.   get id of this bkgnd
  161.   put "Looking for all the FONTS available to this stack."
  162.   if it <> "2295" then go to bkgnd id 2295
  163.   put Resources("FOND") into field "fontField"
  164.   put SortLines( field "fontField", "A" ) into field "fontField"
  165.   put crunch( field "fontField") into field "fontField"
  166.   set script of field "fontField" to field "fontField"
  167.   put "Looking for all the SOUNDS available to this stack."
  168.   put Resources("snd ") into field "sndField"
  169.   repeat with i = 1 to number of lines of field "sndField"
  170.     put LowerToUpper(char 1 of line i of field "sndField") into char 1 of line i of field "sndField"
  171.   end repeat
  172.   put SortLines( field "sndField", "A" ) into field "sndField"
  173.   put "Found them."
  174.   put crunch( field "sndField") into field "sndField"
  175.   set script of field "sndField" to field "sndField"
  176.   unlock
  177.   hide msg
  178.   pop card
  179.   idle
  180. end startUp
  181.  
  182. on resume
  183.   set userLevel to 5
  184.   set the cursor to 4
  185.   makeMenus
  186.   getWithIt
  187.   idle
  188. end resume
  189.  
  190. on openStack
  191.   global CheckUp
  192.   if CheckUp <> empty then exit openStack
  193.   get short name of card
  194.   if it is "First" then startup
  195.   else resume
  196. end openStack
  197.  
  198. on closeStack
  199.   global CheckUp
  200.   put empty into CheckUp
  201.   closing
  202.   pass closeStack
  203. end closeStack
  204.  
  205. on suspend
  206.   global CheckUp
  207.   put empty into CheckUp
  208.   closing
  209.   pass suspend
  210. end suspend
  211.  
  212. on author
  213.   lockcard
  214.   go card "the stack starter"
  215.   send mouseUp to btn "Ego"
  216. end author
  217.  
  218. on backToChicago
  219.   lockcard
  220.   push card
  221.   get id of this bkgnd
  222.   if it <> "2295" then go to bkgnd id 2295
  223.   send backToChicago to field "BS"
  224.   pop card
  225. end backToChicago
  226.  
  227. on bkgndScript
  228.   lockcard
  229.   push card
  230.   get id of this bkgnd
  231.   if it <> "2295" then go to bkgnd id 2295
  232.   send bkgndScript to field "BS"
  233.   pop card
  234. end bkgndScript
  235.  
  236. on btnScript
  237.   lockcard
  238.   push card
  239.   get id of this bkgnd
  240.   if it <> "2295" then go to bkgnd id 2295
  241.   send btnScript to field "BS"
  242.   pop card
  243. end btnScript
  244.  
  245. on bomb
  246.   put the name of target into temp
  247.   put 3 into count
  248.   repeat with i = 4210 to 4214
  249.     play count
  250.     wait until the sound is "done"
  251.     wait 10
  252.     set icon of temp to i
  253.     if count = 0 then Flash 2
  254.     subtract 1 from count
  255.   end repeat
  256. end bomb
  257.  
  258. on Bye
  259.   repeat 2
  260.     set icon of Card btn "Bye" to 4019
  261.     set icon of Card btn "Bye"to 4018
  262.   end repeat
  263. end Bye
  264.  
  265. on cardScript
  266.   lockcard
  267.   push card
  268.   get id of this bkgnd
  269.   if it <> "2295" then go to bkgnd id 2295
  270.   send cardScript to field "BS"
  271.   pop card
  272. end cardScript
  273.  
  274. on changeFont
  275.   global TargetEnter
  276.   answer "Point to btn whose FONT you wish to change." with "Cancel" or "OK"
  277.   if it is "Cancel" then exit changeFont
  278.   put 1 into TargetEnter
  279. end changeFont
  280.  
  281. on changeFont1
  282.   global TargetEnter, NewBtn, NewBtnN
  283.   if word 2 of NewBtn is "Button" then
  284.     ask "This Button needs a name." with "Please, type name here."
  285.     if it is empty then exit changeFont1
  286.     set name of NewBtnN to it
  287.     put it after word 1 to 2 of NewBtnN
  288.     put it into NewBtn
  289.   end if
  290.   answer "Change font of " & NewBtnN with "Quit" or "Not This Btn" or "OK"
  291.   if it is "Not This Btn" then exit changeFont1
  292.   put empty into TargetEnter
  293.   hide msg
  294.   if it is "Quit" then exit changeFont1
  295.   iconCheck
  296. end changeFont1
  297.  
  298. on closeCard
  299.   global Start
  300.   add 1 to Start
  301.   pass closeCard
  302. end closeCard
  303.  
  304. on closing
  305.   global SaveLevel, menu1, menu2
  306.   hideSome
  307.   put DeleteMenu(menu1) into menu1
  308.   put DeleteMenu(menu2) into menu2
  309. end closing
  310.  
  311. on crash
  312.   push card
  313.   lockcard
  314.   go to first card
  315.   repeat with i = 6 down to 2
  316.     hide btn id i
  317.   end repeat
  318.   hideAll
  319.   set icon of btn id 1 to 4214
  320.   unlockcard
  321.   send mouseUp to btn id 1
  322.   lockcard
  323.   repeat with i = 2 to 6
  324.     show btn id i
  325.   end repeat
  326.   pop card
  327.   show menuBar
  328. end Crash
  329.  
  330. on credits
  331.   go card "the stack starter"
  332.   send mouseUp to btn "Credits"
  333. end credits
  334.  
  335. on curse
  336.   play "Yeow"
  337.   set icon of btn "Ninja" to 4160
  338.   set icon of btn "Ninja" to 4161
  339.   play "Crunch"
  340.   set the cursor to -1
  341.   set icon of btn "Ninja" to 4137
  342.   play "Evil Laugh"
  343.   wait 5 secs
  344. end curse
  345.  
  346. on cursors
  347.   put "Click the mouse to select cursor."
  348.   put empty into cursorid
  349.   repeat with i = 0 to 88
  350.     set cursor to i
  351.     wait 10
  352.     if the mouseClick is true then exit repeat
  353.     wait for 20 ticks
  354.     if cursorid is 89 then exit cursors
  355.   end repeat
  356.   subtract 1 from i
  357.   put "Set the cursor to" && i
  358.   do msg
  359.   wait 5 secs
  360. end cursors
  361.  
  362. on dedications
  363.   go card "the stack starter"
  364.   send mouseUp to btn "dedications"
  365. end dedications
  366.  
  367. on deleteButton
  368.   global BypassBtnMsg, DontAsk
  369.   if DontAsk is empty then
  370.     answer "Do you REALLY want to delete that button?" with "Don't Ask" or "Cancel" or "Yes"
  371.     if it is "Don't Ask" then put it into DontAsk
  372.     else if it is "Cancel" then
  373.       put BypassBtnMsg into temp
  374.       put "something" into BypassBtnMsg
  375.       doMenu "Copy Button"
  376.       doMenu "Paste Button"
  377.       put temp into BypassBtnMsg
  378.     else pass deleteButton
  379.   end if
  380. end deleteButton
  381.  
  382. on deleteField
  383.   global StopAsk, BypassFieldMsg
  384.   if StopAsk is empty then
  385.     answer "Do you Really want to delete that button?" with "Don't Ask" or "Cancel" or "Yes"
  386.     if it is "Don't Ask" then put it into StopAsk
  387.     else if it is "Cancel" then
  388.       put BypassFieldMsg into temp
  389.       put "something" into BypassFieldMsg
  390.       doMenu "Copy Field"
  391.       doMenu "Paste Field"
  392.       put temp into BypassFieldMsg
  393.     else pass deleteField
  394.   end if
  395. end deleteField
  396.  
  397. on deprotect1
  398.   lockcard
  399.   push card
  400.   get id of this bkgnd
  401.   if it <> "2295" then go to bkgnd id 2295
  402.   send deprotect1 to field "BS"
  403.   pop card
  404. end deprotect1
  405.  
  406. on diskSpaceAvail
  407.   put the diskSpace / 1024 && "K available on this disk"
  408.   wait 120
  409.   hide msg
  410. end diskSpaceAvail
  411.  
  412. on egress
  413.   global SaveLevel
  414.   hideSome
  415.   goodbye
  416.   lockcard
  417.   if the short name of this stack contains "Stack Starter" then
  418.     getready
  419.     exit egress
  420.   else put "It's a good idea to show the date or revision number"
  421.   answer " Would you like to modify stack name?" with "Yes" or "No"
  422.   if it is "No" then
  423.     hide msg
  424.     getready
  425.     exit egress
  426.   else if it is "Yes" then
  427.     ask "Modify stack name" && quote & the short name of this stack & quote && "to...?" with the short name of this stack && bkgnd btn "Date"
  428.     put it into temp
  429.     set name of this stack to (temp)
  430.   end if
  431.   hide msg
  432.   set userLevel to SaveLevel
  433.   getready
  434. end egress
  435.  
  436. on enterKey --                     Toggle Tools With Enter Key
  437.   if the tool = "Browse Tool"
  438.   then
  439.   if the optionkey is down
  440.   then choose field tool
  441. else choose button tool
  442. else
  443.   if the tool = "Button Tool"
  444.   then
  445.   if the optionkey is down then choose browse tool
  446.   else choose Field Tool
  447. else
  448.   if the tool = "Field Tool"
  449.   then
  450.   if the optionkey is down
  451.   then choose button tool
  452. else choose Browse tool
  453. else
  454.   choose Browse tool
  455. end if
  456. end if
  457. end if
  458. end EnterKey
  459.  
  460. on Eye this
  461.   if this is "Blink" then set icon of btn "Eye" to 4038
  462.   else if this is "C" then set icon of btn "Eye" to 4033
  463.   else if this is "D" then set icon of btn "Eye" to 4037
  464.   else if this is "L" then set icon of btn "Eye" to 4034
  465.   else if this is "R" then set icon of btn "Eye" to 4036
  466.   else if this is "U" then set icon of btn "Eye" to 4035
  467. end Eye
  468.  
  469. on fieldScript
  470.   lockcard
  471.   push card
  472.   get id of this bkgnd
  473.   if it <> "2295" then go to bkgnd id 2295
  474.   send fieldScript to field "BS"
  475.   pop card
  476. end fieldScript
  477.  
  478. on freeSpace
  479.   set the numberFormat to "0.00"
  480.   put (the freeSize of this stack/ 1024) && "K" into FS
  481.   put FS && " of free space left over from deleting objects in" && the short name of this stack
  482.   if FS is "0.00 K" then
  483.   else if the diskSpace < 805000 then
  484.     put "Not enough space on this disk to compact"
  485.   else
  486.     answer "Would you like to compact away this" && FS & "?" with "No" or "Yes"
  487.     if it is "Yes" then
  488.       put "Reclaiming" && FS && "of free space for you to use."
  489.       doMenu "Compact Stack"
  490.       beep 2
  491.       put (the freeSize of this stack/ 1024) && "K" into FS
  492.       put FS && " of free space in" && the short name of this stack
  493.     end if
  494.   end if
  495.   wait 2 secs
  496.   hide msg
  497.   send mouseUp to field "FreeSpaceMon2"
  498. end freeSpace
  499.  
  500. on FreeSpaceMon
  501.   lockcard
  502.   set visible of field "FreeSpaceMon1" to not visible of field "FreeSpaceMon1"
  503.   if visible of field "FreeSpaceMon1" is true then
  504.     put "Free Space:" into field "FreeSpaceMon1"
  505.     show field "FreeSpaceMon2"
  506.     show bkgnd btn "FreeSpaceMon"
  507.     set hilite of bkgnd btn "FreeSpaceMon" to true
  508.     FreeSpaceMon1
  509.   else
  510.     hide field "FreeSpaceMon2"
  511.     hide bkgnd btn "FreeSpaceMon"
  512.   end if
  513. end FreeSpaceMon
  514.  
  515. on FreeSpaceMon1
  516.   set the numberFormat to "0.00"
  517.   put (the freeSize of this stack/1024) && "K" into field "FreeSpaceMon2"
  518. end FreeSpaceMon1
  519.  
  520. on getready
  521.   lock
  522.   repeat with i = 3 to 6
  523.     hide btn id i
  524.   end repeat
  525. end getready
  526.  
  527. on getSpecs
  528.   lockcard
  529.   push card
  530.   get id of this bkgnd
  531.   if it <> "2295" then go to bkgnd id 2295
  532.   send getSpecs to field "BS"
  533.   pop card
  534. end getSpecs
  535.  
  536. on getSpecsFirst
  537.   lockcard
  538.   push card
  539.   get id of this bkgnd
  540.   if it <> "2295" then go to bkgnd id 2295
  541.   send getSpecsFirst to field "BS"
  542.   pop card
  543. end getSpecsFirst
  544.  
  545. on getWithIt
  546.   lockcard
  547.   get the time
  548.   answer "The time is " & it
  549.   choose select tool
  550.   choose browse tool
  551. end getWithIt
  552.  
  553. on goodbye
  554.   set lockMessages to True
  555.   go to first card
  556.   repeat with i = 3 to 5
  557.     show btn id i
  558.   end repeat
  559.   hide btn id 6
  560.   send mouseUp to btn id 4
  561.   show btn id 6
  562. end goodbye
  563.  
  564. on heapSpaceAvail
  565.   put the heapSpace / 1024 && "K is remains currently available in application heapspace."
  566.   wait 120
  567.   hide msg
  568. end heapSpaceAvail
  569.  
  570. on help
  571.   egress
  572.   closeStack
  573.   pass help
  574. end help
  575.  
  576. on hideall
  577.   hide menuBar
  578.   hide msg
  579.   hide tool window
  580.   hide pattern window
  581. end hideall
  582.  
  583. on hideSome
  584.   hide msg
  585.   hide tool window
  586.   hide pattern window
  587. end hideSome
  588.  
  589. on home
  590.   egress
  591.   closeStack
  592.   pass home
  593. end home
  594.  
  595. on homeScript
  596.   set cursor to 4
  597.   lockcard
  598.   edit script of stack "Home"
  599.   pop card
  600. end homeScript
  601.  
  602. on HyperCardVersion
  603.   get the version
  604.   if it is "1.0" then
  605.     put "1.01" into it
  606.   end if
  607.   put "The HyperCard version you are currently using is" && it
  608.   wait 2 secs
  609.   hide msg
  610. end HyperCardVersion
  611.  
  612. on HyperEditOn
  613.   global hyperedittemp, DontAsk, StopAsk, BypassBtnMsg, BypassFieldMsg
  614.   put 1 into BypassBtnMsg
  615.   put 1 into BypassFieldMsg
  616.   put 1 into DontAsk
  617.   put 1 into StopAsk
  618. end HyperEditOn
  619.  
  620. on HyperEditOff
  621.   global hyperedittemp, DontAsk, StopAsk, BypassBtnMsg, BypassFieldMsg
  622.   lockcard
  623.   put empty into BypassBtnMsg
  624.   put empty into BypassFieldMsg
  625.   put empty into DontAsk
  626.   put empty into StopAsk
  627. end HyperEditOff
  628.  
  629. on index
  630.   put the name of target into temp  -- because btns are bkgnd & card
  631.   repeat with iconid = 4178 to 4179
  632.     set icon of temp to iconid
  633.     play "Click"
  634.   end repeat
  635.   go to card id 12388
  636. end index
  637.  
  638. on iconCheck
  639.   global NewBtn, NewBtnN
  640.   get icon of NewBtnN
  641.   if it <> 0 then
  642.     answer "You can't change fonts on a btn with an icon." with "Remove Icon" or "Cancel"
  643.     if it is "Cancel" then exit iconCheck
  644.     else
  645.       if it is "Remove Icon" then set icon of NewBtnN to 0
  646.     end if
  647.   end if
  648.   set showName of NewBtnN to true
  649.   lockcard
  650.   put textAlign of btn NewBtnN into newAlign
  651.   put textFont of btn NewBtnN into newFont
  652.   put textHeight of btn NewBtnN into newHeight
  653.   put textSize of btn NewBtnN into newSize
  654.   put textStyle of btn NewBtnN into newStyle
  655.   if hilite of btn NewBtnN is true then
  656.     put "true" into hiliteCheck
  657.   else put "false" into hiliteCheck
  658.   --put style of NewBtnN into newStyle2
  659.   push card
  660.   go to card "The Button Font Changer"
  661.   set name of btn id 20 to NewBtn
  662.   set textAlign of btn id 20 to newAlign
  663.   set textFont of btn id 20 to newFont
  664.   set textHeight of btn id 20 to newHeight
  665.   set textSize of btn id 20 to newSize
  666.   set textStyle of btn id 20 to newStyle
  667.   set hilite of btn id 20 to hiliteCheck
  668.   --set style of btn id 20 to newStyle2
  669. end iconCheck
  670.  
  671. on info
  672.   put word 1 to 2 of name of the target && the id of target into temp
  673.   if icon of temp <> 0 then
  674.     repeat with iconid = 4180 to 4188
  675.       set icon of temp to iconid
  676.     end repeat
  677.   end if
  678.   answer "Sorry, but this feature not yet supported."
  679. end info
  680.  
  681. on installHomeCardIcon
  682.   lockcard
  683.   push card
  684.   get id of this bkgnd
  685.   if it <> "2295" then go to bkgnd id 2295
  686.   send installHomeCardIcon to field "BS"
  687.   pop card
  688. end installHomeCardIcon
  689.  
  690. on intro
  691.   global Break
  692.   hideall
  693.   set lockRecent to True
  694.   set lockMessages to True
  695.   go to first card
  696.   show btn id 6
  697.   repeat with i = 2 to 8
  698.     if i is 2 then visual scroll down
  699.     else if i is 3 then visual dissolve slow
  700.     else if i is 4 then visual wipe down slow
  701.     else if i is 5 then visual barn door open slow
  702.     else if i is 6 then visual barn door close slow
  703.     else if i is 7 then visual wipe right slow
  704.     else if i is 8 then visual wipe left slow
  705.     go to card i
  706.     introInterupt
  707.     if Break <> empty then exit intro
  708.   end repeat
  709.   go to ninth card
  710.   play "Click"
  711.   wait until the sound is "done"
  712.   go to tenth card
  713.   play "Click"
  714.   wait until the sound is "done"
  715.   go to ninth card
  716.   play "Click"
  717.   wait until the sound is "done"
  718.   introInterupt
  719.   if Break <> empty then exit intro
  720.   repeat with i = 1 to 8
  721.     if i is 1 then
  722.       visual dissolve slow
  723.       go to eighth card
  724.     else if i is 2 then
  725.       visual venetian blinds
  726.       go to sixth card
  727.     else if i is 3 then
  728.       visual dissolve slow
  729.       go to first card
  730.     end if
  731.     introInterupt
  732.     if Break <> empty then exit intro
  733.   end repeat
  734. end intro
  735.  
  736. on introInterupt
  737.   global introComplete, Break
  738.   if the mouseClick is true then
  739.     if introComplete is empty then
  740.       put "card" && quote & "the stack starter" & quote into introComplete
  741.     end if
  742.     set lockMessages to false
  743.     visual dissolve slow to black
  744.     visual dissolve slow
  745.     go to introComplete
  746.     show menubar
  747.     put 1 into Break
  748.   end if
  749. end introInterupt
  750.  
  751. on LNPC
  752.   lock
  753.   set visible of bkgnd btn id 72 to not visible of bkgnd btn id 72
  754.   if visible of bkgnd btn id 72 is true then
  755.     show bkgnd btn id 73
  756.     show field id 78
  757.     show field id 79
  758.   else
  759.     hide bkgnd btn id 73
  760.     hide field id 78
  761.     hide field id 79
  762.   end if
  763. end LNPC
  764.  
  765. on lock
  766.   set lockscreen to true
  767. end lock
  768.  
  769. on lockcard
  770.   set lockscreen to true
  771.   set lockmessages to true
  772.   set lockrecent to true
  773. end lockcard
  774.  
  775. on makeMenus
  776.   global menu1, menu2
  777.   put NewMenu("Editors","Script of Button...","Script of Field..." ,"Script of Card...","Script of Bkgnd...","Script of Stack..." ,"Script of Home","-","DeProtect Stack","HyperEdit","HyperSound‚Ñ¢" ,"ResCopy","ResEdit","SoundEdit‚Ñ¢")into menu1
  778.   put NewMenu("Misc.","Crash","OverLoad","Panic","Pause")into menu2
  779. end makeMenus
  780.  
  781. on mouseEnter
  782.   global TargetEnter, NewBtn, NewBtnid, NewBtnN
  783.   if TargetEnter <> empty then
  784.     wait 40
  785.     put the short name of the target into NewBtn
  786.     put the target into NewBtnN
  787.     put the id of the target into NewBtnid
  788.     put "Change font of " & NewBtnN
  789.     if word 2 of NewBtnN <> "Button" then exit mouseEnter
  790.     changeFont1
  791.   else pass mouseEnter
  792. end mouseEnter
  793.  
  794. on mouseLocation
  795.   lockcard
  796.   set visible of field "Mouse Loc1" to not visible of field "Mouse Loc1"
  797.   if visible of field "Mouse Loc1" is true then
  798.     put "Mouse Location:" into field "Mouse Loc1"
  799.     show field "Mouse Loc2"
  800.     show bkgnd btn "Mouse Loc"
  801.     set hilite of bkgnd btn "Mouse Loc" to true
  802.   else
  803.     hide field "Mouse Loc2"
  804.     hide bkgnd btn "Mouse Loc"
  805.   end if
  806. end mouseLocation
  807.  
  808. on mouseUp
  809.   global ActiveField
  810.   hide msg
  811.   put empty into ActiveField
  812.   if visible of field "FreeSpaceMon1" is true then FreeSpaceMon1
  813.   pass mouseUp
  814. end mouseUp
  815.  
  816. --                   Gesture by Ted Kaehler
  817. on mouseStillDown
  818.   -- Edit the script of a button if you
  819.   -- press and hold the mouse button inside the button, and quickly
  820.   -- move in and out of the top edge of the button twice.
  821.   if "button" is not in the name of the target then exit mouseStillDown
  822.   global editTicks, editState
  823.   if (the ticks)-editTicks > 120 then
  824.     put the ticks into editTicks
  825.     put 0 into editState
  826.   else
  827.     if word 2 of the name of the target <> "button" then exit mouseStillDown
  828.     get the rect of the target
  829.     if the rect of the target is empty then exit mouseStillDown
  830.     if the mouseV < (item 2 of it) then
  831.       if editState = 0 then put 1 into editState
  832.       if editState = 2 then put 3 into editState
  833.     end if
  834.     if the mouseV > (item 2 of it) then
  835.       if editState = 1 then put 2 into editState
  836.       if editState = 3 then put 4 into editState
  837.     end if
  838.   end if
  839.   --put editState
  840.   if editState = 4 then edit script of the name of the target
  841. end mouseStillDown
  842.  
  843. function LineClicked
  844. return (trunc((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) +1)))
  845. end LineClicked
  846.  
  847. on newbutton
  848.   global BypassBtnMsg, NewBtn, NewBtnId, NewBtnN
  849.   if BypassBtnMsg is empty then
  850.     ask "How far forward should this button be?" with (the number of the target)
  851.     if it > the number of the target then
  852.       ask "The number must be equal or lower than" with (the number of the target)
  853.     end if
  854.     if it is empty then put (the number of the target) into it
  855.     put it into newnum
  856.     set the cursor to 4
  857.     lockcard
  858.     if newnum < the number of the target then
  859.       repeat until the number of the target is newnum
  860.         type "-" with commandkey --- or, domenu "Send farther"
  861.       end repeat
  862.     end if
  863.     if the optionkey is up and the commandKey is down then
  864.       put the target into NewBtnN
  865.       set autoHilite of NewBtnN to true
  866.       set style of NewBtnN to rectangle
  867.       doMenu "Button Info..."
  868.       put the short name of NewBtnN into NewBtn
  869.       put the name of NewBtnN into NewBtnN
  870.       put word 1 of NewBtnN && "btn id" && id of NewBtnN into NewBtnId
  871.       choose browse tool
  872.       changeFont1
  873.     end if
  874.   end if
  875. end newbutton
  876.  
  877. on newfield
  878.   global BypassFieldMsg
  879.   if BypassFieldMsg is empty then
  880.     ask "How far forward should this field be?" with (the number of the target)
  881.     if it > the number of the target then
  882.       ask "The number must be equal or lower than" with (the number of the target)
  883.     end if
  884.     if it is empty then put (the number of the target) into it
  885.     put it into newnum
  886.     set the cursor to 4
  887.     lockcard
  888.     if newnum < the number of the target then
  889.       repeat until the number of the target is newnum
  890.         type "-" with commandkey --- or, domenu "Send farther"
  891.       end repeat
  892.     end if
  893.     if the commandkey is down and the optionkey is up then
  894.       set the style of the target to rectangle
  895.       domenu field info...
  896.     end if
  897.   end if
  898. end newfield
  899.  
  900. on Ninja what
  901.   if what is "Blink" then set icon of btn "Ninja" to 4145
  902.   else if what is "C" then set icon of btn "Ninja" to 4137
  903.   else if what is "D" then set icon of btn "Ninja" to 4141
  904.   else if what is "L" then set icon of btn "Ninja" to 4138
  905.   else if what is "R" then set icon of btn "Ninja" to 4140
  906.   else if what is "U" then set icon of btn "Ninja" to 4139
  907.   else if what is "winkR" then
  908.     set icon of btn "Ninja" to 4143
  909.     curse
  910.   else if what is "winkL" then
  911.     set icon of btn "Ninja" to 4144
  912.     curse
  913.   end if
  914. end Ninja
  915.  
  916. on openApl
  917.   ask "Open what non-HyperCard document?" with "Type name of document to be opened here"
  918.   if it is empty then exit openApl
  919.   put it into doc
  920.   ask "What application does this document require" with "Type the name of the program here."
  921.   if it is empty then exit openApl
  922.   put it into apl
  923.   open doc with apl
  924. end openApl
  925.  
  926. on openCard
  927.   hideSome
  928.   push card
  929.   if the userlevel < 5 then set the userlevel to 5
  930.   pass openCard
  931. end openCard
  932.  
  933. on openField
  934.   global ActiveField
  935.   put name of target into ActiveField
  936. end openField
  937.  
  938. on closeField
  939.   global ActiveField
  940.   put empty into ActiveField
  941. end closeField
  942.  
  943. on overLoad
  944.   play "Static"
  945.   hide menuBar
  946.   push card
  947.   visual dissolve to black
  948.   play "Static"
  949.   wait until the sound is "done"
  950.   go to first card
  951.   beep
  952.   Answer "Stack Overload!  Erase Current Disk?" with "Yes" or "No" or "Cancel"
  953.   if it <> "Yes" then answer "                       Too Late." with Sorry
  954.   play "Evil Laugh"
  955.   answer "                      Just kidding."
  956.   visual dissolve to black
  957.   pop card
  958.   show menuBar
  959. end overLoad
  960.  
  961. on panic
  962.   set lockMessages to true
  963.   hideAll
  964.   set lockRecent to true
  965.   go to card "Panic Spredsheet"
  966.   wait until the mouseClick
  967.   pop card
  968.   show menuBar
  969. end panic
  970.  
  971. on pause
  972.   global Break, introComplete
  973.   put empty into Break
  974.   put id of this card into introComplete
  975.   repeat until the mouseClick
  976.     if Break <> empty then exit pause
  977.     Intro
  978.   end repeat
  979.   set lockMessages to false
  980.   visual effect dissolve slow
  981.   go introComplete
  982.   show menubar
  983. end pause
  984.  
  985. on piGrid
  986.   set visible of bkgnd btn "Grid Cover" to not visible of bkgnd btn "Grid Cover"
  987. end piGrid
  988.  
  989. on scroll this
  990.   if this is "D" then
  991.     visual scroll down very fast to gray
  992.     visual scroll down very fast
  993.   else if this is "L" then
  994.     visual scroll left very fast to gray
  995.     visual scroll left very fast
  996.   else if this is "R" then
  997.     visual scroll right very fast to gray
  998.     visual scroll right very fast
  999.   else if this is "U" then
  1000.     visual scroll up very fast to gray
  1001.     visual scroll up very fast
  1002.   end if
  1003. end scroll
  1004.  
  1005. on ShowHiddenBtns
  1006.   lockcard
  1007.   push card
  1008.   get id of this bkgnd
  1009.   if it <> "2295" then go to bkgnd id 2295
  1010.   send ShowHiddenBtns to field "BS"
  1011.   pop card
  1012. end ShowHiddenBtns
  1013.  
  1014. on ShowHiddenFields
  1015.   lockcard
  1016.   push card
  1017.   get id of this bkgnd
  1018.   if it <> "2295" then go to bkgnd id 2295
  1019.   send ShowHiddenFields to field "BS"
  1020.   pop card
  1021. end ShowHiddenFields
  1022.  
  1023. on SizeofStack
  1024.   answer "Sorry, but this feature is not available yet."
  1025.   -- set the numberFormat to "0.00"
  1026.   -- get the size of this stack
  1027.   -- put it / 1024 && "K" into SS
  1028.   -- answer "The size of this stack is" && SS
  1029. end SizeofStack
  1030.  
  1031. on skull
  1032.   put the name of target into temp
  1033.   put 0 into count
  1034.   repeat 3
  1035.     if count < 2 then play "Evil Laugh"
  1036.     set icon of temp to 4114
  1037.     set icon of temp to 4113
  1038.     add 1 to count
  1039.   end repeat
  1040. end skull
  1041.  
  1042. on stackScript
  1043.   put filename("STAK") into fname
  1044.   if fname is empty then exit stackScript
  1045.   push card
  1046.   set cursor to 4
  1047.   lockcard
  1048.   edit script of stack fname
  1049.   pop card
  1050. end stackScript
  1051.  
  1052. on stackSpaceAvail
  1053.   put the stackSpace / 1024 && "K remains available in the Macintosh operating system stack."
  1054.   wait 120
  1055.   hide msg
  1056. end stackSpaceAvail
  1057.  
  1058. on StartDown
  1059.   if the short name of this stack contains "Stack Starter" then
  1060.     answer "Be safe, work with a copy of this stack." with "Just Looking" or "OK Copy It"
  1061.     if it is "OK Copy It" then
  1062.       doMenu "Save a Copy..."
  1063.     end if
  1064.   end if
  1065.   show btn id 6
  1066. end StartDown
  1067.  
  1068. on OsErr err
  1069.   lockcard
  1070.   push card
  1071.   get id of this bkgnd
  1072.   if it <> "2295" then go to bkgnd id 2295
  1073.   send OsErr to field "BS"
  1074.   pop card
  1075. end OsErr
  1076.  
  1077. on test
  1078.   --global Start
  1079.   -- Use this as a scripting interrupt, and have it display
  1080.   --status messages, global and container contents, etc...
  1081.   answer "This is a test" --&& Start && "cards closed"
  1082. end test
  1083.  
  1084. on timeDate
  1085.   put the time && the long date
  1086.   wait 2 secs
  1087.   hide msg
  1088. end timeDate
  1089.  
  1090. on updated
  1091.   lockcard
  1092.   push card
  1093.   get id of this bkgnd
  1094.   if it <> "2295" then go to bkgnd id 2295
  1095.   send updated to field "BS"
  1096.   pop card
  1097. end updated
  1098.  
  1099. on unlock
  1100.   set lockscreen to false
  1101. end unlock
  1102.  
  1103. on unlockcard
  1104.   set lockscreen to false
  1105.   set lockmessages to false
  1106.   set lockrecent to false
  1107. end unlockcard
  1108.  
  1109. on getLinNum
  1110.   global LN, LNS
  1111.   put textHeight of the target into lineHght
  1112.   if wideMargins of target is true then
  1113.     put lineHght/3 into WM
  1114.   else put 0 into WM
  1115.   put (((item 2 of the clickLoc)-(item 2 of the rect of target+ WM)) /lineHght)+1 into A
  1116.   put trunc(A) into LN
  1117.   put (the scroll of the target / lineHght) into B
  1118.   --if E > number of lines of target then put "0" into E
  1119.   put trunc(A + B) into LNS
  1120. end getLinNum
  1121.  
  1122. on returnkey
  1123.   if the shiftkey is down and the optionkey is down then
  1124.     HyperEditOn
  1125.     hyperedit the name of this card
  1126.     HyperEditOff
  1127.   else if the optionkey is down then
  1128.     HyperEditOn
  1129.     hyperedit the name of this background
  1130.     HyperEditOff
  1131.   else if the shiftkey is down then
  1132.     HyperEditOn
  1133.     hyperedit the name of this stack
  1134.     HyperEditOff
  1135.   else pass returnkey
  1136. end returnkey
  1137.  
  1138.